//
//  YMAboutController.swift
//  YMSwiftUI
//
//  Created by anscen on 2022/4/26.
//

import UIKit
import SwiftUI

class YMAboutController: UIViewController {
    @Environment(\.presentationMode) var presentationMode
    @IBOutlet weak var titleLab: UILabel!
    @IBOutlet weak var imageV: UIImageView!
    private var titleName :String? = nil
    var timer :Timer? = nil
    convenience init(title :String) {
        self.init()
        self.titleName = title
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        self.fd_prefersNavigationBarHidden = false
        self.view.backgroundColor = UIColor.red
        self.titleLab.text = moya.appName + "(" + moya.version + ")"
        debugPrint(self.titleName as Any)
        self.title = "关于我们"
    }
    func startTimer(){
        self.stopTimer()
    }
    func stopTimer(){
        guard let timer = timer else {
            return
        }
        if timer.isValid{
            timer.invalidate()
        }
    }
    @IBAction func action(_ sender: UIButton) {
        let searchView = YMFavView()
        let searchVC = UIHostingController.init(rootView: searchView)
        searchVC.hidesBottomBarWhenPushed = true
        self.navigationController?.pushViewController(searchVC, animated: true)
    }
    @IBAction func privateAction(_ sender: UIButton) {
        let searchVC = YMTableViewController()
        searchVC.hidesBottomBarWhenPushed = true
        self.navigationController?.pushViewController(searchVC, animated: true)
    }
}
